package main

import "fmt"

func alloc() {
	fmt.Println("allocate resource")
}

func free() {
	fmt.Println("free resource")
}

func test() {
	alloc()
	defer free()
	fmt.Println("test alloc and free")
}

func main() {
	test()
	fmt.Println("end")
}
